package com.asianrapid.service.impl.sys;

import com.asianrapid.dao.LampDao;
import com.asianrapid.model.sys.LampEntity;
import com.asianrapid.service.sys.LampService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("LampServiceImpl")
public class LampServiceImpl implements LampService {


        @Autowired
        private LampDao lampDao;


        @Override
        public List<LampEntity> lampsList(int pageSize, int start) {
            int state = 0;
            return lampDao.lampList( pageSize,  start, state);
        }

        @Override
        public int lampsSize( int pageSize, int start) {
            int state = 0;
            return lampDao.lampSize( pageSize, start, state);
        }


    @Override
    public void insertLamp(LampEntity lampEntity) {
        lampEntity.setState(0);
        lampDao.insertLamp(lampEntity);
    }


    @Override
    public void updateLamp(LampEntity lampEntity) {

        lampDao.updateLamp(lampEntity);
    }


    @Override
    public void deleteLamp(List<String> groupId) {

        lampDao.updateDeleteLamp(groupId);
    }


    @Override
    public LampEntity getLamp(Integer groupId) {


        return lampDao.getLamp(groupId);
    }
}
